<?php

declare(strict_types=1);

namespace App\Listens;

use GSC\Config;
use GSC\Singleton;

class Pool
{
    use Singleton;

    public function workerStart($server, $workerId)
    {
        $config = Config::getInstance()->get('database', []);
        if (!empty($config)) {
            \EasyDB\PDO::getInstance($config);
        }

        $redisConfig = Config::getInstance()->get('redis', []);
        if (!empty($redisConfig)) {
            \EasyDB\Redis::getInstance($redisConfig);
        }
    }
}
